package tank.draw;

import java.util.Vector;

/**
 * @Author: WaveKing
 * @Description: TODO
 * @Date: Created in 13:08 2023/11/11
 * @Modified By:
 */
public class mytank extends tank{
    bullet b = null;

    public mytank(int x, int y) {
        super(x, y);
    }
    public void shot(){
        if (bullets.size() == 5){
            return;
        }
        switch (getDirect()){
            case 0:
                b = new bullet(getX()+20,getY(),0);
                break;
            case 1:
                b = new bullet(getX()+60,getY()+20,1);
                break;
            case 2:
                b = new bullet(getX()+20,getY()+60,2);
                break;
            case 3:
                b = new bullet(getX(),getY()+20,3);
                break;
        }
        //将新创建的子弹加入到子弹集合中
        bullets.add(b);
        new Thread(b).start();
    }

}
